<%-- 
    Document   : rubrique
    Created on : 30 mars 2013, 15:12:36
    Author     : Alice
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>

<jsp:include page="header.jsp"></jsp:include>

<s:div id="bloc_contenu_avec_trait">
    Trier par : 
    <s:a action="rubrique" includeParams="get">
        <s:param name="trie"><c:out value="prixCroissant"/></s:param>
        prix croissant
    </s:a> 
        <s:a action="rubrique" includeParams="get">
        <s:param name="trie"><c:out value="prixDecroissant"/></s:param>
        prix décroissant
    </s:a>
    <H2>${message}</H2>
    <s:set name="i" value="0" id="ii"/>
    <c:forEach items="${products}" var="product" >
        <s:div id="bloc_produit">
            <table border="0">
                <tr>
                    <td valign="top" class="td_miniature"><img src="pages/img/img_produit_type/${product.idProductType}.jpg" width="80%" height="80%"/></td>
                    <td valign="top">

                        <c:set var="idProduct" value="${product.idProductType}"/>
                        <s:a action="ficheProduit">
                            <s:param name="idProduct"><c:out value="${idProduct}"/></s:param>
                            <b>${product.title}</b>
                        </s:a>

                        <br /><br />${product.description}</td>
                    <td valign="top" class="td_miniature"><font color="#b22233" size="4"><b>
                            <s:if test="#session['USER'] != null">
                                    <s:if test="#session['USER'].getCountry().devise=='USD'">
                                        <fmt:formatNumber maxFractionDigits="2"><c:out value="${product.price*sessionScope['RATE']}" /></fmt:formatNumber> $
                                    </s:if>
                                    <s:else>
                                        ${product.price} €
                                    </s:else>
                                </s:if>
                                <s:else>
                                    ${product.price} €
                                </s:else>

                        </b></font><br />
                        <!--<s:a action="ajouterPanier" includeParams="get"><s:param name="idProduct">${product.idProductType}</s:param><input type="image" src="pages/img/btn_ajouter.jpg" alt="Ajouter au panier" /></s:a>-->
                            <br /> En stock





                            <img src="pages/img/ico_en_stock.png"/>
                            
                        </td>
                    </tr>

                </table>
        </s:div>
    </c:forEach>
</s:div>

<jsp:include page="footer.jsp"></jsp:include>
